package com.nbsaas.boot.user.ext.apis;


import com.nbsaas.boot.rest.response.ListResponse;
import com.nbsaas.boot.rest.response.ResponseObject;
import com.nbsaas.boot.user.api.domain.response.UserInfoResponse;
import com.nbsaas.boot.user.ext.domain.request.*;
import com.nbsaas.boot.user.ext.domain.response.TokenResponse;
import com.nbsaas.boot.user.ext.domain.response.UserInfoExtResponse;

public interface UserExtApi {


    ResponseObject<Boolean> checkRegister(UserRegisterRequest request);


    /**
     * 检查账号是否注册，注册了返回用户id，没有注册返回-1
     *
     * @param request
     * @return
     */
    ResponseObject<Long> checkRegister2(UserRegisterRequest request);

    /**
     * 注册功能
     *
     * @param request
     * @return
     */
    ResponseObject<UserInfoResponse> register(UserRegisterRequest request);

    /**
     * 修改密码
     *
     * @param request
     * @return
     */
    ResponseObject<?> updatePassword(UserUpdatePasswordRequest request);


    /**
     * 重置密码
     *
     * @param request
     * @return
     */
    ResponseObject<?> resetPassword(UserResetPasswordRequest request);


    ResponseObject<UserInfoExtResponse> login(UserLoginRequest request);


    ResponseObject<UserInfoExtResponse> loginOauth(UserLoginOauthRequest request);

    ResponseObject<String> findOpenId(UserLoginOauthRequest request);

    ResponseObject<TokenResponse> findOpenData(UserLoginOauthRequest request);

    /**
     * 获取用户所有的权限
     *
     * @param userId
     * @return
     */
    ListResponse<String> selectPermissionByUser(Long userId);


    /**
     * 通过手机号获取用户信息,要是该手机号没有用户，动态注册用户
     *
     * @param phone 手机号
     * @return 用户信息
     */
    ResponseObject<UserInfoExtResponse> loginByPhone(String phone);

}
